package com.cn.demo.springboot.shiro.mapper;

import java.util.Set;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.cn.demo.springboot.shiro.entity.ShiroUser;

@Mapper
public interface ShiroMapper {

	/**
	 * 根据用户账号查询用户信息
	 * @return
	 */
	@Select("select user_name ,password,user_id from user where user_name = #{account}")
	ShiroUser findUserByAccount(String account);
	
	/**
	 * 根据用户id获取用户权限
	 * 
	 * 如果有用到角色需修改这个查询
	 * 
	 * @param userId
	 * @return
	 */
	@Select("select permissionId from sys_permission where id = #{userId}")
	Set<String> getPermissions(String userId); 
}
